<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAkbusBusTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('akbus_bus', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('batch')->nullable()->comment('购买批次');
            $table->tinyInteger('brand')->nullable()->comment('车辆品牌');
            $table->string('model')->nullable()->comment('规格型号');
            $table->string('engine_num')->nullable()->comment('发动机号');
            $table->string('frame_nun')->nullable()->comment('车架号');
            $table->string('license_plate_num')->nullable()->comment('车牌号');
            $table->string('original')->nullable()->comment('原值');
            $table->string('discount')->nullable()->comment('折扣额');
            $table->string('net_worth')->nullable()->comment('净值');
            $table->string('old_license_plate_num')->nullable()->comment('旧车牌');
            $table->date('issue_at')->nullable()->comment('发证日期');
            $table->string('max_num')->nullable()->comment('核载人数');
            $table->date('start_use_at')->nullable()->comment('开始使用时间');
            $table->string('length')->nullable()->comment('车长');
            $table->string('voucher')->nullable()->comment('凭证号');
            $table->tinyInteger('type')->nullable()->comment('车辆类型');
            $table->string('note')->nullable()->comment('备注');
            $table->date('start_at')->nullable()->comment('上户时间');
            $table->date('register_at')->nullable()->comment('注册时间');
            $table->string('vehicle_travel_license_url')->nullable()->comment('行驶证url');
            $table->date('vehicle_travel_license_expire_at')->nullable()->comment('行驶证到期时间');
            $table->string('invoice_url')->nullable()->comment('发票url');
            $table->date('invoice_expire_at')->nullable()->comment('发票有效期');
            $table->string('sign_certificate_url')->nullable()->comment('登记证书url');
            $table->date('sign_certificate_expire_at')->nullable()->comment('登记证书有效期');
            $table->date('qualified_certificate_expire_at')->nullable()->comment('合格证书有效期');
            $table->string('qualified_certificate_url')->nullable()->comment('合格证书url');
            $table->date('maintenance_at')->nullable()->comment('维护时间');
            $table->date('cylinder_annual_inspection_at')->nullable()->comment('气瓶年检时间');
            $table->date('technical_assessment_at')->nullable()->comment('技术评定时间');

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('akbus_bus');
    }
}
